﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ESPlus.Application.Group.Server;
using ESPlus.Widgets;
using ESPlus.Rapid;
using ESPlus.Application.CustomizeInfo.Server;
/*
 * 本demo采用的是ESFramework的免费版本，不需要再次授权、也没有使用期限限制。若想获取ESFramework其它版本，请联系 sky.zhuwei@163.com
 * 
 */
namespace ESFDemo.Server
{
    static class Program
    {
        private static ESPlus.Rapid.RapidServerEngine RapidServerEngine = new ESPlus.Rapid.RapidServerEngine();
        
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                GroupManager groupManager = new GroupManager();
                groupManager.CreateGroup("dd", "dd", "dd", true);
                groupManager.Groups[0].AddUser("1");
                groupManager.Groups[0].AddUser("2");
                groupManager.Groups[0].AddUser("3");

                Program.RapidServerEngine.Initialize(9018, new EmptyCustomizeInfoBusinessHandler(),null,groupManager);
                ESPlus.Widgets.MainServerForm mainForm = new ESPlus.Widgets.MainServerForm();
                Program.RapidServerEngine.ConfigMainServerForm(mainForm);

                Application.Run(mainForm);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }        
    }
}
